#include <ut/UnitTest.h>
#include <ilrt/Runtime.h>

namespace illib_ut{
	extern void Log_ut();
	extern void Exception_ut();
	extern void System_ut();
	extern void Hash_ut();
	extern void BasicLinkedList_ut();
	extern void BasicRedBlackTree_ut();
	extern void Allocator_ut();
	extern void LinkedList_ut();
	extern void RedBlackTree_ut();
	extern void Buffer_ut();
	extern void Vector_ut();
}

namespace ilrt_ut{
	extern void String_ut();
	extern void Type_ut();
	extern void Interpreter_ut();
	extern void Runtime_ut();
}

int main(int argc, const char** argv) {
	try{
		{
			illib::System::Allocator allocator;
			illib::MemoryTracker::Tracker tracker;
			illib_ut::Log_ut();
			//illib_ut::Exception_ut();
			illib_ut::System_ut();
			illib_ut::Hash_ut();
			illib_ut::BasicLinkedList_ut();
			illib_ut::BasicRedBlackTree_ut();
			illib_ut::Allocator_ut();
			illib_ut::LinkedList_ut();
			illib_ut::RedBlackTree_ut();
			illib_ut::Buffer_ut();
			illib_ut::Vector_ut();
			ut::summary();
		}

		{
			ilrt_ut::Runtime_ut();
			illib::System::Allocator allocator;
			illib::MemoryTracker::Tracker tracker;
			ilrt::Runtime runtime;
			ilrt_ut::String_ut();
			ilrt_ut::Type_ut();
			ilrt_ut::Interpreter_ut();
			ut::summary();
		}
	} catch(illib::Exception &e) {
		ut::test(AT(), false, "Unexpected exception %s", e.message());
	}
}
